'use strict';

/**
 * @param {Egg.Application} app - egg application
 */
module.exports = app => {
  const { router, controller } = app;
  router.get('/', controller.home.index);
  //发表文章
  router.post('/api/add',controller.artical.add);
  //修改
  router.put('/api/edit',controller.artical.update);
  //删除
  router.delete('/api/del',controller.artical.del);
  //查询
  router.get('/api/articalList',controller.artical.articalList);
  //类目查询
  router.get('/api/articalTypeList',controller.artical.articalTypeList);
  //按作者查询
  router.get('/api/articalUsername',controller.artical.articalUsername);
  //查询分类
  router.get('/api/types',controller.home.types);
};
